package com.usian.controller;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {
    @Autowired
    private DruidDataSource druidDataSource;

    /*@RequestMapping("hello")
    @ResponseBody
    public String hello(){
        System.out.println(druidDataSource.getDriverClassName());
        System.out.println(druidDataSource.getUsername());
        return "hello world";
    }*/

    @RequestMapping("demo2")
    public String demo2(Model model){
        model.addAttribute("msg","世界你好！！");
        return "hello";
    }
}
